<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: Eigen support</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Eigen support<div class="ingroups"><a class="el" href="../../d0/de1/group__core.html">Core functionality</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa79981ae2c2dbeea3ccf788d3a851a74"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _layout&gt; </td></tr>
<tr class="memitem:gaa79981ae2c2dbeea3ccf788d3a851a74"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gaa79981ae2c2dbeea3ccf788d3a851a74">cv::cv2eigen</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;src, Eigen::Tensor&lt; _Tp, 3, _layout &gt; &amp;dst)</td></tr>
<tr class="memdesc:gaa79981ae2c2dbeea3ccf788d3a851a74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> to an Eigen::Tensor.  <a href="../../d0/daf/group__core__eigen.html#gaa79981ae2c2dbeea3ccf788d3a851a74">More...</a><br /></td></tr>
<tr class="separator:gaa79981ae2c2dbeea3ccf788d3a851a74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga28d4c291bb74c3b915e2fd62f03906b1"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </td></tr>
<tr class="memitem:ga28d4c291bb74c3b915e2fd62f03906b1"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#ga28d4c291bb74c3b915e2fd62f03906b1">cv::cv2eigen</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;src, Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;dst)</td></tr>
<tr class="separator:ga28d4c291bb74c3b915e2fd62f03906b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaed24d680285c19716286aa24ae7a579"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </td></tr>
<tr class="memitem:gaaed24d680285c19716286aa24ae7a579"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gaaed24d680285c19716286aa24ae7a579">cv::cv2eigen</a> (const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, _cols &gt; &amp;src, Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;dst)</td></tr>
<tr class="separator:gaaed24d680285c19716286aa24ae7a579"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5df03dfca2194b7cb59266bcf72f2246"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:ga5df03dfca2194b7cb59266bcf72f2246"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#ga5df03dfca2194b7cb59266bcf72f2246">cv::cv2eigen</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;src, Eigen::Matrix&lt; _Tp, Eigen::Dynamic, Eigen::Dynamic &gt; &amp;dst)</td></tr>
<tr class="separator:ga5df03dfca2194b7cb59266bcf72f2246"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f3a879a3af721ecde8d149dbfc7eeb7"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _rows, int _cols&gt; </td></tr>
<tr class="memitem:ga3f3a879a3af721ecde8d149dbfc7eeb7"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#ga3f3a879a3af721ecde8d149dbfc7eeb7">cv::cv2eigen</a> (const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, _cols &gt; &amp;src, Eigen::Matrix&lt; _Tp, Eigen::Dynamic, Eigen::Dynamic &gt; &amp;dst)</td></tr>
<tr class="separator:ga3f3a879a3af721ecde8d149dbfc7eeb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga137921303143b3f17de1307b1feb0860"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:ga137921303143b3f17de1307b1feb0860"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#ga137921303143b3f17de1307b1feb0860">cv::cv2eigen</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;src, Eigen::Matrix&lt; _Tp, Eigen::Dynamic, 1 &gt; &amp;dst)</td></tr>
<tr class="separator:ga137921303143b3f17de1307b1feb0860"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeaf7bbf5b36b766deeaf0c529717ccbb"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _rows&gt; </td></tr>
<tr class="memitem:gaeaf7bbf5b36b766deeaf0c529717ccbb"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gaeaf7bbf5b36b766deeaf0c529717ccbb">cv::cv2eigen</a> (const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, 1 &gt; &amp;src, Eigen::Matrix&lt; _Tp, Eigen::Dynamic, 1 &gt; &amp;dst)</td></tr>
<tr class="separator:gaeaf7bbf5b36b766deeaf0c529717ccbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafd7f2b330fe822f42f918f848ca21dd5"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:gafd7f2b330fe822f42f918f848ca21dd5"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gafd7f2b330fe822f42f918f848ca21dd5">cv::cv2eigen</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;src, Eigen::Matrix&lt; _Tp, 1, Eigen::Dynamic &gt; &amp;dst)</td></tr>
<tr class="separator:gafd7f2b330fe822f42f918f848ca21dd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa57eee0d2918816f75823d9941f1db7b"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _cols&gt; </td></tr>
<tr class="memitem:gaa57eee0d2918816f75823d9941f1db7b"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gaa57eee0d2918816f75823d9941f1db7b">cv::cv2eigen</a> (const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, 1, _cols &gt; &amp;src, Eigen::Matrix&lt; _Tp, 1, Eigen::Dynamic &gt; &amp;dst)</td></tr>
<tr class="separator:gaa57eee0d2918816f75823d9941f1db7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1add06b744a69bc05e1e16a5eb20be3e"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:ga1add06b744a69bc05e1e16a5eb20be3e"><td class="memTemplItemLeft" align="right" valign="top">static Eigen::TensorMap&lt; Eigen::Tensor&lt; _Tp, 3, Eigen::RowMajor &gt; &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#ga1add06b744a69bc05e1e16a5eb20be3e">cv::cv2eigen_tensormap</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src)</td></tr>
<tr class="memdesc:ga1add06b744a69bc05e1e16a5eb20be3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> data to an Eigen::TensorMap.  <a href="../../d0/daf/group__core__eigen.html#ga1add06b744a69bc05e1e16a5eb20be3e">More...</a><br /></td></tr>
<tr class="separator:ga1add06b744a69bc05e1e16a5eb20be3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7d024b90a359c852cce5dff47ebc77a4"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _layout&gt; </td></tr>
<tr class="memitem:ga7d024b90a359c852cce5dff47ebc77a4"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#ga7d024b90a359c852cce5dff47ebc77a4">cv::eigen2cv</a> (const Eigen::Tensor&lt; _Tp, 3, _layout &gt; &amp;src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst)</td></tr>
<tr class="memdesc:ga7d024b90a359c852cce5dff47ebc77a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts an Eigen::Tensor to a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a>.  <a href="../../d0/daf/group__core__eigen.html#ga7d024b90a359c852cce5dff47ebc77a4">More...</a><br /></td></tr>
<tr class="separator:ga7d024b90a359c852cce5dff47ebc77a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabf167b4c7d0dbed6bc3ae6e3fda25734"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </td></tr>
<tr class="memitem:gabf167b4c7d0dbed6bc3ae6e3fda25734"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gabf167b4c7d0dbed6bc3ae6e3fda25734">cv::eigen2cv</a> (const Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst)</td></tr>
<tr class="separator:gabf167b4c7d0dbed6bc3ae6e3fda25734"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac9fd7b6d6cc93f82b77da378f9565be3"><td class="memTemplParams" colspan="2">template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </td></tr>
<tr class="memitem:gac9fd7b6d6cc93f82b77da378f9565be3"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d0/daf/group__core__eigen.html#gac9fd7b6d6cc93f82b77da378f9565be3">cv::eigen2cv</a> (const Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;src, <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, _cols &gt; &amp;dst)</td></tr>
<tr class="separator:gac9fd7b6d6cc93f82b77da378f9565be3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>These functions are provided for OpenCV-Eigen interoperability. They convert <code><a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a></code> objects to corresponding <code>Eigen::Matrix</code> objects and vice-versa. Consult the <a href="https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html">Eigen documentation</a> for information about the <code>Matrix</code> template type.</p>
<dl class="section note"><dt>Note</dt><dd>Using these functions requires the <code>Eigen/Dense</code> or similar header to be included before this header. </dd></dl>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa79981ae2c2dbeea3ccf788d3a851a74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa79981ae2c2dbeea3ccf788d3a851a74">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[1/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _layout&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Tensor&lt; _Tp, 3, _layout &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

<p>Converts a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> to an Eigen::Tensor. </p>
<p>The method converts a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> to an Eigen Tensor with shape (H x W x C) where: H = number of rows W = number of columns C = number of channels</p>
<p>Usage: </p><div class="fragment"><div class="line">Mat a_mat(...);</div><div class="line"><span class="comment">// populate Mat with values</span></div><div class="line">Eigen::Tensor&lt;float, 3, Eigen::RowMajor&gt; a_tensor(...);</div><div class="line"><a class="code" href="../../d0/daf/group__core__eigen.html#gaa79981ae2c2dbeea3ccf788d3a851a74">cv2eigen</a>(a_mat, a_tensor);</div></div><!-- fragment --> 
</div>
</div>
<a id="ga28d4c291bb74c3b915e2fd62f03906b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga28d4c291bb74c3b915e2fd62f03906b1">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[2/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="gaaed24d680285c19716286aa24ae7a579"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaed24d680285c19716286aa24ae7a579">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[3/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, _cols &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="ga5df03dfca2194b7cb59266bcf72f2246"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5df03dfca2194b7cb59266bcf72f2246">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[4/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, Eigen::Dynamic, Eigen::Dynamic &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="ga3f3a879a3af721ecde8d149dbfc7eeb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3f3a879a3af721ecde8d149dbfc7eeb7">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[5/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _rows, int _cols&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, _cols &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, Eigen::Dynamic, Eigen::Dynamic &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="ga137921303143b3f17de1307b1feb0860"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga137921303143b3f17de1307b1feb0860">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[6/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, Eigen::Dynamic, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="gaeaf7bbf5b36b766deeaf0c529717ccbb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeaf7bbf5b36b766deeaf0c529717ccbb">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[7/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _rows&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, Eigen::Dynamic, 1 &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="gafd7f2b330fe822f42f918f848ca21dd5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafd7f2b330fe822f42f918f848ca21dd5">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[8/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, 1, Eigen::Dynamic &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="gaa57eee0d2918816f75823d9941f1db7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa57eee0d2918816f75823d9941f1db7b">&#9670;&nbsp;</a></span>cv2eigen() <span class="overload">[9/9]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _cols&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::cv2eigen </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, 1, _cols &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Matrix&lt; _Tp, 1, Eigen::Dynamic &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="ga1add06b744a69bc05e1e16a5eb20be3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1add06b744a69bc05e1e16a5eb20be3e">&#9670;&nbsp;</a></span>cv2eigen_tensormap()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Eigen::TensorMap&lt;Eigen::Tensor&lt;_Tp, 3, Eigen::RowMajor&gt; &gt; cv::cv2eigen_tensormap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a>&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

<p>Maps <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> data to an Eigen::TensorMap. </p>
<p>The method wraps an existing <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a> data array with an Eigen TensorMap of shape (H x W x C) where: H = number of rows W = number of columns C = number of channels</p>
<p>Explicit instantiation of the return type is required.</p>
<dl class="section note"><dt>Note</dt><dd>Caller should be aware of the lifetime of the <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> instance and take appropriate safety measures. The <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> instance will retain ownership of the data and the Eigen::TensorMap will lose access when the <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> data is deallocated.</dd></dl>
<p>The example below initializes a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> and produces an Eigen::TensorMap: </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};</div><div class="line">Mat a_mat(2, 2, <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga0610d99405b809062622588c25ed5c8f">CV_32FC3</a>, arr);</div><div class="line">Eigen::TensorMap&lt;Eigen::Tensor&lt;float, 3, Eigen::RowMajor&gt;&gt; a_tensormap = cv2eigen_tensormap&lt;float&gt;(a_mat);</div></div><!-- fragment --> 
</div>
</div>
<a id="ga7d024b90a359c852cce5dff47ebc77a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7d024b90a359c852cce5dff47ebc77a4">&#9670;&nbsp;</a></span>eigen2cv() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _layout&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::eigen2cv </td>
          <td>(</td>
          <td class="paramtype">const Eigen::Tensor&lt; _Tp, 3, _layout &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a>&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

<p>Converts an Eigen::Tensor to a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a>. </p>
<p>The method converts an Eigen::Tensor with shape (H x W x C) to a <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">cv::Mat</a> where: H = number of rows W = number of columns C = number of channels</p>
<p>Usage: </p><div class="fragment"><div class="line">Eigen::Tensor&lt;float, 3, Eigen::RowMajor&gt; a_tensor(...);</div><div class="line"><span class="comment">// populate tensor with values</span></div><div class="line">Mat a_mat;</div><div class="line"><a class="code" href="../../d0/daf/group__core__eigen.html#ga7d024b90a359c852cce5dff47ebc77a4">eigen2cv</a>(a_tensor, a_mat);</div></div><!-- fragment --> 
</div>
</div>
<a id="gabf167b4c7d0dbed6bc3ae6e3fda25734"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabf167b4c7d0dbed6bc3ae6e3fda25734">&#9670;&nbsp;</a></span>eigen2cv() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::eigen2cv </td>
          <td>(</td>
          <td class="paramtype">const Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a>&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
<a id="gac9fd7b6d6cc93f82b77da378f9565be3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac9fd7b6d6cc93f82b77da378f9565be3">&#9670;&nbsp;</a></span>eigen2cv() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp , int _rows, int _cols, int _options, int _maxRows, int _maxCols&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cv::eigen2cv </td>
          <td>(</td>
          <td class="paramtype">const Eigen::Matrix&lt; _Tp, _rows, _cols, _options, _maxRows, _maxCols &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, _rows, _cols &gt; &amp;&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="../../d3/ddd/eigen_8hpp.html">opencv2/core/eigen.hpp</a>&gt;</code></p>

</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:40 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
